package com.fengye.common.constants;

/**
 * @author sunlei
 * @version 1.0
 * @date 2023/9/4 21:05:29
 * @description 常量
 */
public class CommonConstant {

    /**
     * http请求头中设置token值的key
     */
    public static final String HTTP_HEADER_BEARER_KEY = "Authorization";
    /**
     * http请求头中设置token值的前缀
     */
    public static final String HTTP_HEADER_BEARER_TOKEN_PREFIX = "Bearer ";

    /**
     * Redis中存的验证码的key
     */
    public static final String REDIS_CAPTCHA_KEY = "captcha";

    /**
     * 登录成功后存在redis中token的key的前缀
     */
    public static final String REDIS_LOGIN_TOKEN_KEY_PREFIX = "login_token_";

    /**
     * 登录成功后存在redis中LoginUserDetails数据的key的前缀
     */
    public static final String REDIS_LOGIN_USER_DETAILS_KEY_PREFIX = "login_userinfo_";

    /**
     * 评论的根ID的默认空值为-1
     */
    public static final Integer COMMENT_ROOT_ID_BLANK = -1;

    /**
     * 过滤器异常对应的处理器地址
     */
    public static final String FILTER_ERROR_CONTROLLER_PATH = "/filter/error";

    /**
     * 将过滤器抛出的异常对象设置到HttpServletRequest对象中，该值为对应的key
     */
    public static final String FILTER_ERROR_EXCEPTION_KEY = "filterException";

    /**
     * 文章是草稿
     */
    public static final int ARTICLE_STATUS_DRAFT = 1;

    /**
     * 文章是正常发布状态
     */
    public static final int ARTICLE_STATUS_NORMAL = 0;

    /**
     * 热门文章条数
     */
    public static final String ARTICLE_HOT_LIMIT = "limit 10";

    /**
     * 文章浏览量redis的key
     */
    public static final String ARTICLE_VIEW_COUNT_REDIS_KEY = "article:viewCount";

    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";
}
